#pragma once

#include <boost/shared_ptr.hpp>
#include "LMath.h"

namespace ln
{

    typedef double (*AnimationValFun)(double x);

    inline double FunCalcHalfS4(double x)
    {
        return CalcNextS(x, 4);
    }

    inline double FunCalcSCurve(double x)
    {
        return CalcSCurve(x, 4);
    }

    class LAnimationAssist
    {
    public:
        LAnimationAssist(AnimationValFun fun = FunCalcHalfS4);
        ~LAnimationAssist(void);

        double ExpenseTime();
        bool IsStop() const;
        void Stop();
        void Start(double v1, double v2, __int64 time_ms);
        double GetEndValue() const {return m_end_value;}

    private:
        bool m_is_stop;
        double m_start_value;
        double m_end_value;

        __int64 m_time_ms;
        int m_start_time;

        AnimationValFun m_val_fun;
    };

    typedef boost::shared_ptr<LAnimationAssist> LAnimationAssistPtr;

}